home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
355
/
source
/
oops_js
/
read.me
< prev
next >
Wrap
Text File
|
1990-02-02
|
5KB
|
96 lines
OOPS is an enhanced version of ERROUT, which was included with the first
beta release of JS Modula. OOPS takes the compiler-generated ERR.DAT and
ERR.LST files, and flags the errors in your source file, including error
messages(!). ERROUT had some nasty tendencies: it only wrote a file called
ERR.OUT, and would overwrite an old ERR.OUT if one existed. It only output
error numbers, which meant an annoying trip to the ERRLIST.DOK file to see
what had gone wrong. It was not intended to be a complete error reporter;
OOPS should do the job.
USAGE NOTES:
I have included all the source files and library object modules you'll
need to do whatever you want with OOPS. I have also included sample
ERR.DAT and ERR.LST files for JUNK.MOD, so you can run OOPS to see what it
does. It should read and delete the ERR files, and rewrite the source file
with errors flagged (*<@*), and the error message(s) on the line(s) following
the error(s).
To use it after a compile that results in the "errors detected" message,
just run OOPS from the same directory as the ERR.DAT, ERR.LST and source
files. Reload your source into your text editor, and look for the @ signs.
Error messages all start with ^^^ to indicate the line in which the error
was detected. The program limits itself to flagging 5 errors in a line,
and is currently not able to check multiple files (* maybe someday... *).
Only the last file of a multi-file compile is left in ERR.DAT, so you are
limited to single file compiles (* unless you're _sure_! *).
By the way, library source material included here is...
(*======================================================*)
(* Copyright (c) 1987, JEFFERSON SOFTWARE *)
(* 12416 N 28th Dr #18-236, Phoenix, AZ 85029-2434 *)
(* (602)243-3106 CIS: 73637,1245; GEnie: JSMODULA *)
(* PHASE BBS (602)849-1287 (up to 2400 baud) has source *)
(* and answers about Jefferson Software Modula in SIG 8 *)
(* Permission to use this source is given to all who *)
(* agree to include Jefferson Software's copyright *)
(* notice, address, and phone number in all copies of *)
(* this source or source derived from this source. *)
(* Please send any changes, updates or bugs to us at *)
(* Jefferson Software. If you have code you want to *)
(* share with us all, send it and any documentation to *)
(* us. Please tell us if you want your name included. *)
(* *)
(* PERMISSION TO USE THIS SOURCE DOES NOT INCLUDE *)
(* USING OR MODIFYING IT FOR DIRECT COMMERCIAL GAIN *)
(*======================================================*)
IMPLEMENTATION NOTES:
While developing this program, I discovered some very interesting things
you may want to try with the libraries. Included in the archive are hacked
source files for 2 library modules, System and FileSystem. By removing the
unneeded calls to System (HALTX) from FileSystem, I was able to cut over
6k from the final product, by eliminating the need to link FPSys,
GEMDOSProcess, and XBIOSMisc to oops. All the object files needed to link
together oops are included, but remember that System and FileSystem are
cut-down versions. (* VERY cut down in the case of System! *) You need
to compile the errmsg files too, DEFs first, and errmsg1 before the others.
Library hacking is a good way to cut your runtime programs down to size.
All you need to do is trace the dependencies back and find out where the
cutting will do the most good. If there's any way to eliminate System, you
too will save the 6k+ of overhead it generates. I left the other modules
alone, as they are mostly small procedures which call smaller procedures
including mostly INLINE code. You must include the dummy System module,
though; even if you eliminate all the calls to System, the linker still
looks for it automatically.
As previously noted, the old ERROUT would overwrite an existing file
if one existed, leaving the leftovers at the end of the file. This was due
to a limitation in FileSystem (Lookup): if you specified a New file, and
Lookup found one, it opened the old one and didn't tell you whether it had
actually created a file. This was fixed by adding the result code "callerror"
for this circumstance. Now if you specify a new file on a Lookup call, and
it opens the old file, the file.result will be callerror. You may ignore
it if you please, but if you really want a new file, Delete the old one, and
call lookup again to create a new file.
About those ERRMSG files...
I went ten rounds with the compiler trying to put all the error messages in
the main module of oops, and the compiler won. There is a limit of 127 cases
(the first thing I tried), and also a limit on string constants (not sure,
but my guess would be 127 for this one too). Another odd error I got was
"program too long", but I think that was a fluke. The bottom line is, I had
to split up all those constants into 3 modules, and IMPORT them into the
main module. I also had to import the type of the array containing all the
error messages, it is declared in the first errmsg file (ERRMSG1.DEF), and
IMPORTed everywhere else. All that just to avoid reading in an error file.
(* I like self-contained programs *)
I hope all you JS Modula users out there find this one useful.
Enjoy!
Ken Badertscher (KBAD) 2/22/87